package com.atguigu.day02.test;

public class OperatorExer {
    public static void main(String[] args) {
        int i = 5498;

        int qianwei = i / 1000;
        int baiwei = (i / 100) % 10;
        int shiwei = (i / 10) % 10;
        int gewei = i % 10;

        System.out.println("i的千位数为：" + qianwei);
        System.out.println("i的百位数为：" + baiwei);
        System.out.println("i的十位数为：" + shiwei);
        System.out.println("i的个位数为：" + gewei);

        int num = gewei + shiwei + baiwei + qianwei;
        System.out.println("个十百千之和 = " + num);
    }
}
